package com.he.statemodel;

import com.he.statemodel.context.WorkContext;
import com.he.statemodel.state.concretestate.MorningState;

public class Client {
    public static void main(String[] args) {
        WorkContext workContext = new WorkContext(new MorningState());
        int[] hours = {9, 11, 12, 14, 16, 17, 18, 19, 20, 21};
        for (int hour : hours) {
            if (hour >= 18 && Math.random() * 100 > 50) {
                workContext.setFinished(true);
            }
            workContext.setWorkHour(hour);
            workContext.workhandle();
        }
    }
}
